<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>相邻块元素垂直外边距的合并</title>
    <style>
        div {
            width: 200px;
            height: 100px;
            background-color: pink;
        }
        .one {
            margin: 10px 20px;
        }
        /* 两个盒子相距30px 不是40px */
        .two {
            margin-top: 30px;
            margin-left: 40px;
        }
    </style>
</head>
<body>
    <div class="one">w我是第一个</div>
    <div class="two">我是第二个</div>
</body>
</html>